#include <iostream>
#include <vector>
using namespace std;

void printVector(vector<int> & v)
{
    for (vector<int>::iterator it = v.begin(); it != v.end(); it ++)
    {
        cout << *it  << " ";
    }
    cout << endl;
}
//vector容器构造
void tets01()
{
    vector<int> v1;
    for (int i = 0; i < 10; i++)
    {
        v1.push_back(i);
    }
    printVector(v1);

    vector<int> v2(v1.begin(), v1.end());
    printVector(v2);

    //n个elem方式构造
    vector<int>v3(10, 100);
    printVector(v3);

    //拷贝
    vector<int>v4(v3);
    printVector(v4);
}

int main()
{
    tets01();
    return 0;
}